import request from "@/utils/request";

// 获取字段映射关系
export function getOption(params) {
  return request({
    url: `/v1/base/get-option`,
    method: "get",
    params,
  });
}

//获取下拉选项数据
export const overallOptions = (data) =>
  request({
    url: "/options",
    method: "post",
    data,
  });
//获取下拉选项数据-新（拉平）
export const allopts = (data) =>
  request({
    url: "/opts",
    method: "post",
    data,
  });
// 获取业务日志
export const getBusinessLog = (params) =>
  request({
    url: `/oplog/${params.tag}`,
    method: "get",
    params,
  });

// 获取物流属性option
export const getLogisticsAttr = (params) =>
  request({
    baseURL: window.APP_GETEWAY.goods,
    url: `/api/goods/get-logistics-attributes`,
    method: "get",
    params,
  });

// 获取仓库option
export const getWarehouseOptions = (params) =>
  request({
    baseURL: window.APP_GETEWAY.wms,
    url: "/api/warehouse-option",
    method: "get",
    params,
  });

// 获取平台
export const getPlatformOptions = (params) => {
  return request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/platform/platforms",
    method: "get",
    params,
  });
};

// 获取货币option
export const getCurrency = (params) => {
  return request({
    baseURL: window.APP_GETEWAY.goods,
    url: "/api/goods/get-currency",
    method: "get",
    params,
  });
};

// 获取国家option 别名+中文
export const getCountry = (params) => {
  return request({
    baseURL: window.APP_GETEWAY.goods,
    url: "/api/goods/get-country-lable",
    method: "get",
    params,
  });
};

export const uploadFile = (data, type) =>
  request({
    url: `/upload/${type}`,
    method: "post",
    data,
  });

// 获取平台列表
export const getPlatform = (params) =>
  request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/platform/platforms",
    method: "get",
    params,
  });

// 站店列表
export const getSites = (params) =>
  request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/platform/sites",
    method: "get",
    params,
  });

// 店铺列表
export const getShop = (data) =>
  request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/shop/drop-list",
    method: "post",
    data,
  });

export const getImportUrl = (params) =>
  request({
    url: `/tpl/get-import-uri/${params.type}`,
    method: "get",
    params,
  });

// 员工
export function personnel(params) {
  return request({
    baseURL: window.APP_GETEWAY.auth,
    url: "/tenant/organization",
    method: "get",
    params,
  }).then((res) => res.data);
}

// 部门
export function department(params) {
  return request({
    baseURL: window.APP_GETEWAY.auth,
    url: "/department",
    method: "get",
    params,
  }).then((res) => res.data);
}

// 获取分类列表
export function classify(params) {
  return request({
    baseURL: window.APP_GETEWAY.goods,
    url: "/base/backend-classification/get-list",
    method: "get",
    params,
  }).then((res) => res.data);
}


//获取报关公司
export function declareCompany(params) {
  return request({
    url: "/opts/declare-company",
    method: "post",
    params,
  })
}

//获取承运人选项
export function carrier(data) {
  return request({
    url: "/opts/carrier",
    method: "post",
    data,
  })
}

//获取配送服务选项
export function deliveryService(data) {
  return request({
    url: "/opts/delivery-service",
    method: "post",
    data,
  })
}